package xyz.lisys.controller;

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@Slf4j
@RestController
@RequestMapping("/error")
public class ErrorController {

    @GetMapping("/404")
    public HashMap<String, Object> notFound() {
        val map = new HashMap<String, Object>();
        map.put("msg", "error-404");
        return map;
    }

    @GetMapping("/any")
    public HashMap<String, Object> error() {
        val map = new HashMap<String, Object>();
        map.put("msg", "error-any");
        return map;
    }

    @GetMapping("/manual")
    public HashMap<String, Object> manual() {
        val map = new HashMap<String, Object>();
        val i = 1 / 0;
        map.put("msg", "error-manual");
        return map;
    }
}
